﻿using System.ComponentModel.DataAnnotations;

namespace RentHouse.DTO
{
    public class AdminUserAddDTO
    {
        /// <summary>
        /// 手机号码
        /// </summary>
        [Required(ErrorMessage ="请输入手机号码")]
        [RegularExpression(@"^1[3456789]\d{9}$",ErrorMessage ="您输入的手机号码格式不正确")]
        public string PhoneNum { get; set; }

        /// <summary>
        /// 姓名
        /// </summary>
        [Required(ErrorMessage ="请输入您的大名")]
        [StringLength(5,ErrorMessage = "请输入正确的姓名")]
        public string Name { get; set; }


        /// <summary>
        /// 密码
        /// </summary>
        [Required(ErrorMessage ="请输入密码")]
        [DataType(DataType.Password,ErrorMessage ="您输入的密码格式不正确")]
        public string Password { get; set; }

        /// <summary>
        /// 确认密码
        /// </summary>
        [Required(ErrorMessage = "请输入确认密码密码")]
        [DataType(DataType.Password, ErrorMessage = "您输入的密码格式不正确")]
        [Compare("Password",ErrorMessage = "两次输入的密码不一致")]
        public string PasswordConfirm { get; set; }

        /// <summary>
        /// 邮箱
        /// </summary>
        [Required(ErrorMessage ="请输入邮箱")]
        [DataType(DataType.EmailAddress,ErrorMessage ="输入的邮箱格式不正确")]
        public string Email { get; set; }

        /// <summary>
        /// 城市Id
        /// </summary>
        public long CityId { get; set; }

        /// <summary>
        /// 角色
        /// </summary>
        public long[] RoleIds { get; set; }
    }
}
